package com.itheima.work01;

import java.util.concurrent.ConcurrentHashMap;

public class Work04 {
    public static void main(String[] args) throws InterruptedException {
        //ConcurrentHashMap存储数据案例
        ConcurrentHashMap <String,String>map = new ConcurrentHashMap<>(100);
        Thread t1 =new Thread(()->{
            for (int i = 0; i <=10000; i++) {
                map.put(i+"",i+"");
            }
        });
        t1.start();
        Thread.sleep(1000);
       for (int i = 0; i < 10000; i++) {
            System.out.println(map.get(i+""));
        }

    }
}
